﻿<html>
    <head>
        <title>OGBot</title>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <link rel="stylesheet" href="/static/layout.css" type="text/css" />
        <link rel="stylesheet" href="/static/general.css" type="text/css" />
        <%
            resources = bot.handles[pid].fetchResources()
            planets = bot.handles[pid].fetchPlanets()
            production = bot.handles[pid].fetchProduction()
        %>
        <script type="text/javascript">
            // Resource ticker
            % for res in ("metal", "crystal", "deuterium"):
            var ${res} = {
                "actual" : ${resources[res]["resources"]["actual"]},
                "production" : ${resources[res]["resources"]["production"]}
            };
            % endfor
            
            // Production countdown
            time = {
                "building" : ${production["building"]["time"]},
                "research" : ${production["research"]["time"]},
                "shipyard" : ${production["shipyard"]["time"]}
            };
        </script>
        <script type="text/javascript" src="/static/resourceticker.js"></script>
        <script type="text/javascript" src="/static/productioncountdown.js"></script>
    </head>
    <body>
        <div id="container">
            <div id="header">
                <h1>
                    OGBot
                </h1>
            </div>
            <div id="navigation">
                <%include file="../tpl/mainmenu.html" />
## %>
            </div>
            <div id="content-container1">
                <div id="content-container2">
                    <div id="section-navigation">
                        <%include file="../tpl/ogame_leftmenu.html" />
## %>
                    </div>
                    <div id="content">
                        <h2>
                            Übersicht
                        </h2>
                        <p style="text-align: center">
                            <h4>Produktion</h4>
                            <table>
                                <tr>
                                    <td>Gebäude</td>
                                    <td>Forschung</td>
                                    <td>Schiffswerft</td>
                                </tr>
                                <tr>
                                    % for name in ("building", "research", "shipyard"):
                                    <td>
                                        ${bot.get_tech_name(production[name]["id"])}<br />
                                        <%
                                            if name == "shipyard":
                                                text = "Anzahl"
                                            else:
                                                text = "Stufe"
                                        %>
                                        ${text}: ${production[name]["level"]}<br />
                                        <span id="time_${name}"></span>
                                    </td>
                                    % endfor
                                </tr>
                            </table>
                        </p>
                    </div>
                    <div id="aside">
                        <h3>
                            Planeten
                        </h3>
                        <p>
                            <ul>
                                % for name, data in planets.items():
                                <li><a href="ajax/cp?id=${data['cp']}">${name} (${data["gal"]}:${data["sys"]}:${data["pos"]})</a></li>
                                % endfor
                            </ul>
                        </p>
                    </div>
                    <div id="footer">
                        Metall: <span id="res-metal"></span> &#124; Kristall: <span id="res-crystal"></span> &#124; Deuterium: <span id="res-deuterium"></span> &#124; Energie: ${resources["energy"]["resources"]["actualFormat"]}
                    </div>
                </div>
            </div>
        </div>
    </body>
</html>